'use strict'
const { View } = window.QUI
import style from './css.css'
import icon from '../../images/7.png'
// window.dataSource = dataSource
class UseBalance extends React.Component {
  render () {
    const { user = { rmb_balance: 0, qb_balance: 0, medium: 'nopic.jpg' }} = this.props
    const medium = user.medium
    const icons = medium.indexOf('nopic.jpg') >= 0 ? icon : medium
    return (
      <View className={ style.usesBalance } >
        <View className={ style.userIcon } style={{ backgroundImage: `url(${icons})` }}></View>
        <View className={ style.rmbBalance }>{(user.rmb_balance / 100).toFixed(2)} 元</View>
        <View className={ style.qbBalance }>{user.qb_balance} 个</View>
      </View>
    )
  }
}
export default UseBalance
